package com.ice.work.moment.user.controller;

import com.honeybee.cloud.framework.common.page.Page;
import com.honeybee.cloud.framework.common.response.ResponseEntity;
import com.honeybee.cloud.framework.oauth.controller.BaseController;
import com.ice.work.moment.facade.user.controller.user.IUserController;
import com.ice.work.moment.facade.user.dto.UserDTO;
import com.ice.work.moment.facade.user.mapper.UserConvertMapper;
import com.ice.work.moment.facade.user.request.PageUserRequest;
import com.ice.work.moment.facade.user.vo.UserVO;
import com.ice.work.moment.user.service.user.IUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description 用户
 * @Author DELL
 * @Create 2019-02-11
 * @Since 1.0.0
 */
@RestController
@Slf4j
public class UserController extends BaseController implements IUserController {

    @Autowired
    private IUserService userService;

    @Override
    public ResponseEntity<Page<UserVO>> pageUser(PageUserRequest request) {
        Page<UserDTO> userDTOPage = userService.page(request);
        return ResponseEntity.ok(UserConvertMapper.INSTANCE.toVO(userDTOPage));
    }

}
